﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Windows.Forms;

namespace ClientApplication
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            int loggedIn = 0;
            Login mLogin = new Login();
            Judge1 mForm2 = new Judge1();
            Admin1 mAdmin1 = new Admin1();
            Admin2 mAdmin2 = new Admin2();
            Admin3 mAdmin3 = new Admin3(); //Behövs
            Admin4 mAdmin4 = new Admin4();
            Admin5 mAdmin5 = new Admin5();
            
            //mAdmin5.StartPosition = FormStartPosition.Manual;
            //mAdmin5.ShowDialog();
          

            Client mClient = new Client("92.92.92.92", 9057, 9057);
            Presenter mPresenter = new Presenter(mLogin, mForm2, mClient, mAdmin1, mAdmin2, mAdmin3, mAdmin4, mAdmin5, ref loggedIn);

            //myClient.SendMessage(uC, "Hej", myClient.IpEp);

            Application.Run(mLogin);
            if (mPresenter.loggedIn == 1)
                Application.Run(mAdmin1);
            else if (mPresenter.loggedIn == 2)
                Application.Run(mForm2);
        }
    }
}
